package com.es.disped.dao.oj.mapper;

import com.es.disped.dao.oj.model.ContestProblem;
import com.es.disped.dao.oj.model.ContestProblemExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface ContestProblemMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_problem
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=ContestProblemSqlProvider.class, method="countByExample")
    long countByExample(ContestProblemExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_problem
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @DeleteProvider(type=ContestProblemSqlProvider.class, method="deleteByExample")
    int deleteByExample(ContestProblemExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_problem
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Insert({
        "insert into contest_problem (problem_id, contest_id, ",
        "title, num, c_accepted, ",
        "c_submit)",
        "values (#{problemId,jdbcType=INTEGER}, #{contestId,jdbcType=INTEGER}, ",
        "#{title,jdbcType=CHAR}, #{num,jdbcType=INTEGER}, #{cAccepted,jdbcType=INTEGER}, ",
        "#{cSubmit,jdbcType=INTEGER})"
    })
    int insert(ContestProblem record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_problem
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @InsertProvider(type=ContestProblemSqlProvider.class, method="insertSelective")
    int insertSelective(ContestProblem record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_problem
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=ContestProblemSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="problem_id", property="problemId", jdbcType=JdbcType.INTEGER),
        @Result(column="contest_id", property="contestId", jdbcType=JdbcType.INTEGER),
        @Result(column="title", property="title", jdbcType=JdbcType.CHAR),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER),
        @Result(column="c_accepted", property="cAccepted", jdbcType=JdbcType.INTEGER),
        @Result(column="c_submit", property="cSubmit", jdbcType=JdbcType.INTEGER)
    })
    List<ContestProblem> selectByExample(ContestProblemExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_problem
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=ContestProblemSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ContestProblem record, @Param("example") ContestProblemExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table contest_problem
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=ContestProblemSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ContestProblem record, @Param("example") ContestProblemExample example);
}